#include "MainWindow.h"
#include <QApplication>
#include <QFile>
#include <QDebug>
#include "AppInitMessage.h"
#include "MyJson.h"
#include "QSSHConnection.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    AppInitMessage appInit;
    appInit.startMessageEvent();

    //加载样式表
    QFile file;
    file.setFileName(":/qss/psblack.css");
    if(file.open(QFile::ReadOnly))
    {
        QString qss = QLatin1String(file.readAll());
        QString paletteColor = qss.mid(20, 7);
        qApp->setPalette(QPalette(QColor(paletteColor)));
        qApp->setStyleSheet(qss);
        qDebug()<<qss;
        file.close();
    }else
    {
        qDebug()<<"open file "<<":/qss/psblack.css" <<"failed  ";
    }
    a.setFont(QFont("Microsoft Yahei", 9));

    MainWindow w;
    w.show();

	MyJson::GetConnectionParam();
	//初始化连接参数
	QSSHConnection::GetInstace("192.168.19.135", 22, "root", "dtxy_2019", 0);
	QSSHConnection::GetInstace()->RunCMD("ls /root");
 
	

    return a.exec();
}
